Importing and exporting markup language data in a spreadsheet application document

ABSTRACT

Methods and systems are provided for importing markup language formatted data into a spreadsheet document and for exporting markup language formatted data from a spreadsheet document. XML data is associated with an XML schema file defining XML data types and data type definitions for applying XML data to the document. An XML data map is prepared that relates that any XML data applied to the document back to corresponding XML elements or attributes defined in the associated schema file. When the document is imported into a spreadsheet application grid, the data map is parsed to find XPATHs in the imported spreadsheet document of XML data and the user entered data. Each XPATH is executed to determine the location, data types and user data for each cell or list object in the document that is related back to the associated schema file. The cells and lists are populated with the XML data and user data, and the data is rendered in the spreadsheet according to the formatting dictated by the XML data applied to the spreadsheet in association with the XML schema file. After an imported document has been edited, or after a document is created to include the application of XML data in association with a selected XML schema file, the document may be exported such that the XML data applied to the document is maintained for subsequent import and use of the document.

FIELD OF THE INVENTION

[0001] The present invention relates generally to importing markuplanguage data to and exporting markup language data from a spreadsheetdocument. More particularly, the present invention relates to importingan eXtensible Markup Language file into a spreadsheet document and toexporting an eXtensible Markup Language document from a spreadsheetdocument.

BACKGROUND OF THE INVENTION

[0002] Computer software applications allow users to create a variety ofdocuments for use in work, education and leisure. For example, aspreadsheet application allows users to store, manipulate, print anddisplay a variety of alphanumeric data. A word processing applicationallows users to create letters, articles, books, memoranda, and thelike. Such applications have a number of well-known strengths, includingrich editing, formatting and calculation.

[0003] To keep up with demands for more advanced functionality for suchcomputer software applications, software developers have begun to usestructured data formats, including markup languages such as eXtensibleMarkup Language (XML), to allow users to annotate a software applicationdocument to give the document a useful structure apart from the normalfunctionality of the software application responsible for creating thedocument or the visible formatting associated with the document. Forexample, the user may wish to create using her spreadsheet application atemplate document for preparation of a purchase order to be used in hercompany's sales department. By applying structure to the document,purchasers or other institutions or persons receiving the document maymake use of the structure by processing the document to utilize datadefined by the document structure spreadsheet application spreadsheetapplication spreadsheet application.

[0004] Some software applications, such as word processing applications,allow users to annotate a document with XML elements so that the usermay define certain data types and data definitions for data insertedinto the document. A resume document, for example, may include an“experience” section in which the user will include present and pastwork experience. Using XML, the user may desire to markup the“experience” section of the document to define that certain allowableinformation in a prescribed order and in a prescribed number may beincluded in the “experience” section of the document. For example, theuser may wish to markup the experience section of the document to allowfour present or past experience items.

[0005] Unfortunately, prior art spreadsheet applications allow verylimited use of XML data. Bulk XML data may be imported where the userpoints to an XML file and the spreadsheet application imports that fileinto the spreadsheet grid. But, the user gets no control over how thedata is laid out or which data is imported because all of the data isimported. Under prior spreadsheet applications, manual coding of XMLdata to a spreadsheet application may be required in which a programmerwrites their own custom code for handling import and/or export of XMLdata. This code may be in the form of an XSLT transformation file, or itmay be a more traditional programming language like VBA or C++. Suchcustom programming is time consuming, expensive and is difficult toapply generally to spreadsheet documents.

[0006] Prior spreadsheet applications do not establish a relationshipbetween the XML data and the spreadsheet grid. A relationship betweenthe XML data and the grid allows the user to have a custom view of theXML data. For example, if a user only wants elements <a>, <b>, and <e>to show up in the grid, and to skip elements <c> and <d>, thatpreference needs to be stored somewhere. Furthermore, if the user wantselement <b> to be displayed first and show up in column A, followed byelements <a> and <e> in columns B and C, that preference needs to bestored as well. If the user wants the data to begin appearing in row 6rather than at the top of the grid sheet, that preference will need tobe stored as well. Because prior spreadsheet applications allow nocustom control over how the data is imported and displayed, there isnothing for the spreadsheet application to remember about the data.Accordingly, no relationship, between the spreadsheet and the XML datais established.

[0007] Accordingly there is a need in the art for methods and systemsthat allow users to import and/or export XML data to and fromspreadsheet grids. There is further a need for methods and systems forthat allow spreadsheet documents to exchange data with other XML-enabledapplications whether or not the other applications understand theprogramming or functionality of the spreadsheet application. There isfurther a need for methods and systems that allow users to build customspreadsheet application views of XML data so that they may readily view,analyze, edit, and produce XML data. There is further a need for methodsand systems that allow programmers to write programs that interactdirectly with XML data in a spreadsheet grid using an XML context.

[0008] It is with respect to these and other considerations that thepresent invention has been made.

SUMMARY OF THE INVENTION

[0009] Embodiments of the present invention provide methods and systemsfor importing markup language formatted data into a spreadsheet documentand for exporting markup language formatted data from a spreadsheetdocument. More particularly, embodiments of the present invention solvethe above and other problems by providing methods and systems forimporting eXtensible Markup Language (XML) data and associated userdata, if available, into a spreadsheet document and for exporting XMLdata and associated user data, if available, from a spreadsheetdocument.

[0010] According to one aspect of the invention, an XML document or XMLdata is associated with an XML schema file defining XML data types anddata type definitions for applying XML data to the spreadsheet document.An XML data map is prepared that relates a spreadsheet grid to theschema file. Generally, the map is the relationship between the grid andthe XML schema. Element <a> goes in cell B1, for instance. The mapcontains an XPATH that points to element <a>, and the XPATH is pairedwith a grid reference. The mapping is essentially a collection ofpairings where for each pairing a given XML element or attributereferenced by an XPATH corresponds to a given location in the grid.

[0011] When the XML document is subsequently imported into a spreadsheetapplication grid, the XML map is selected for determining therelationships between XML data applied to the spreadsheet applicationdocument and the XML schema file associated with the document. The XMLdata map is parsed to find XPATHs in the imported spreadsheet documentpointing in the document to an associated schema file. Each XPATH isexecuted to determine the location, data types and user data for eachcell or list object in the document that is related back to theassociated schema file. The cells and lists are populated withassociated XML data in locations in the grid where the XML data ismapped and according to the rules (element names, syntax, etc.) of theassociated schema file. That is, the grid is populated with XML data,and the data lands in the proper cells, lists, and columns according tothe relationships between the spreadsheet grid and schema as specifiedin the XML data map.

[0012] According to another aspect of the invention, after an importedXML document has been edited, the data in that document may be exportedas XML data. Similarly, a mapped spreadsheet document can be used as ablank template. The user opens the spreadsheet document (template),enters data into the mapped regions, and then exports the data as XMLdata. In either case, the exported XML data may be processed by anyother XML-enabled application, for example, another desktop application,a backend database, a spreadsheet document that has been mapped to thesame schema, and the like.

[0013] Prior to exporting the edited or created document, an XML datamap relating XML data in the document to associated elements orattributes of a selected XML schema file is selected. The XML data mapis iterated to find the location of each cell or list object in thedocument that contains XML data and to locate an XPATH in each of suchcell or list object for pointing the XML data associated with the cellor list object back to associated XML elements or attributes in theselected XML schema file. Each XML element or attribute applied to thedocument and located by parsing the XML data map is applied to ageneralized instance structure of the selected XML schema file to createa hierarchically-structured instance structure of the XML data appliedto the document. The data for cells or list objects located in thedocument by parsing the XML data map are extracted and are arrangedhierarchically according to the generalized instance structure. Thehierarchical arrangement of the XML data and associated user data iswritten to memory or is exported for other subsequent uses.

[0014] These and other features and advantages, which characterize thepresent invention, will be apparent from the reading the followingdetailed description and a review of the associated drawings. It is tobe understood that both the foregoing general description and thefollowing detailed description are exemplary and explanatory only andare not restrictive of the invention as claimed.

BRIEF DESCRIPTION OF THE DRAWINGS

[0015]FIG. 1 is a simplified block diagram illustrating the importing ofeXtensible Markup Language data into a spreadsheet document and showingthe exporting of eXtensible Markup Language data from a spreadsheetdocument.

[0016]FIG. 2 is a block diagram of a computer and associated peripheraland networked devices that provide an exemplary operating environmentfor the present invention.

[0017]FIG. 3 illustrates a computer screen display of a typicalspreadsheet workspace grid and associated tree view pane showing ageneralized instance of an eXtensible Markup Language (XML) schema fileassociated with the based spreadsheet document opened to a spreadsheetapplication workspace grid.

[0018]FIG. 4 is a flow chart illustrating a method for importing XMLdata into a spreadsheet document.

[0019]FIG. 5 is a flow chart illustrating a method for exporting XMLdata from a spreadsheet document.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

[0020] The following description of embodiments of the present inventionis made with reference to the above-described drawings where in likenumerals refer to like parts or components throughout the severalfigures. The present invention is directed to methods and systems forimporting markup language formatted data into a spreadsheet document andfor exporting the markup language-formatted from a spreadsheet document.

[0021] Referring now to FIG. 1, a simplified block diagram illustratingimporting markup language-formatted data into a spreadsheet document andillustrating exporting markup language-formatted data from aspreadsheet. document is described. According to embodiments of thepresent invention, a preferred markup language for use in accordancewith the present invention is the eXtensible Markup Language (XML). Inone embodiment, the present invention is incorporated into the OFFICE™suite of application programs that is manufactured and marked byMicrosoft Corporation of Redmond, Wash. A suitable spreadsheetapplication for use in accordance with the present invention isspreadsheet application® manufactured and marketed by MicrosoftCorporation of Redmond, Wash.

[0022] Referring to FIG. 1, an embodiment of the present inventionprovides a spreadsheet application the ability to natively understandcustom markup language data, such as XML data. For example, if an XMLdata file 100 contains quarterly financial results prepared according toan XML schema file (for example, an XSD file), embodiments of thepresent invention allow that XML data to be imported into a spreadsheetdocument 150 or template with a single import function, such as clickingan import button provided by the spreadsheet application 120.Accordingly, the imported data will “land” in the spreadsheet documentor template 150 in the appropriate cells and columns of the spreadsheetgrid 160 as specified by the designer/creator of the template ordocument. That is, if the user imports an XML document having twoelements for “date” and “amount” data associated with company sales, anembodiment of the present invention will cause the data from the twoelements to import into a position in the target grid 160 in the samepositions as specified by the map.

[0023] As described above, a user may import XML data into a spreadsheetgrid and edit that data for subsequent export. Or, a user may start witha blank mapped grid (for example, a grid that has XML data mapped to it,but no other data) and enter data to the blank mapped grid forsubsequent export. However, if a user adds new data, for example, a newcolumn of data to the spreadsheet grid, that data must be mapped to theXML schema file in order for XML data entered for the new column to beincluded in the exported XML data.

[0024]FIG. 2 and the following discussion are intended to provide abrief, general description of a suitable computing environment in whichthe invention may be implemented. While the invention will be describedin the general context of an application program that runs on anoperating system in conjunction with a personal computer, those skilledin the art will recognize that the invention also may be implemented incombination with other program modules. Generally, program modulesinclude routines, programs, components, data structures, etc. thatperform particular tasks or implement particular abstract data types.Moreover, those skilled in the art will appreciate that the inventionmay be practiced with other computer system configurations, includinghand-held devices, multiprocessor systems, microprocessor-based orprogrammable consumer electronics, cell phones, minicomputers, mainframecomputers, and the like. The invention may also be practiced indistributed computing environments where tasks are performed by remoteprocessing devices that are linked through a communications network. Ina distributed computing environment, program modules may be located inboth local and remote memory storage devices.

[0025] With reference to FIG. 2, an exemplary system for implementingthe invention includes a conventional personal computer 20, including aprocessing unit 21, a system memory 22, and a system bus 23 that couplesthe system memory to the processing unit 21. The system memory 22includes read-only memory (ROM) 24 and random access memory (RAM) 25. Abasic input/output system 26 (BIOS), containing the basic routines thathelp to transfer information between elements within the personalcomputer 20, such as during start-up, is stored in ROM 24. The personalcomputer 20 further includes a hard disk drive 27, a magnetic disk drive28, e.g., to read from or write to a removable disk 29, and an opticaldisk drive 30, e.g., for reading a CD-ROM disk 31 or to read from orwrite to other optical media. The hard disk drive 27, magnetic diskdrive 28, and optical disk drive 30 are connected to the system bus 23by a hard disk drive interface 32, a magnetic disk drive interface 33,and an optical drive interface 34, respectively. The drives and theirassociated computer-readable media provide non-volatile storage for thepersonal computer 20. Although the description of computer-readablemedia above refers to a hard disk, a removable magnetic disk and aCD-ROM disk, it should be appreciated by those skilled in the art thatother types of media which are readable by a computer, such as magneticcassettes, flash memory cards, digital video disks, Bernoullicartridges, and the like, may also be used in the exemplary operatingenvironment.

[0026] A number of program modules may be stored in the drives and RAM25, including an operating system 35 and one or more applicationprograms 100, such as a spreadsheet application program, a wordprocessor program, or other type of program module. Other programmodules illustrated in FIG. 2 include an XML processing module 105, adocument object model (DOM) parser 37, and a simple applicationprogramming interface for XML (SAX) parser 38. According to anembodiment of the invention, the XML module 105 is used by thespreadsheet application 100 for processing data formatted according tothe eXtensible Markup Language. A suitable XML processing module isMSXML manufactured and marketed by Microsoft Corporation of Redmond,Wash.

[0027] A user may enter commands and information into the personalcomputer 20 through a keyboard 40 and pointing device, such as a mouse42. Other input devices (not shown) may include a microphone, joystick,game pad, satellite dish, scanner, or the like. These and other inputdevices are often connected to the processing unit 21 through a serialport interface 46 that is coupled to the system bus, but may beconnected by other interfaces, such as a game port or a universal serialbus (USB). A monitor 47 or other type of display device is alsoconnected to the system bus 23 via an interface, such as a video adapter48. In addition to the monitor, personal computers typically includeother peripheral output devices (not shown), such as speakers orprinters.

[0028] The personal computer 20 may operate in a networked environmentusing logical connections to one or more remote computers, such as aremote computer 49. The remote computer 49 may be a server, a router, apeer device or other common network node, and typically includes many orall of the elements described relative to the personal computer 20,although only a memory storage device 50 has been illustrated in FIG. 2.The logical connections depicted in FIG. 2 include a local area network(LAN) 51 and a wide area network (WAN) 52. Such networking environmentsare commonplace in offices, enterprise-wide computer networks, intranetsand the Internet.

[0029] When used in a LAN networking environment, the personal computer20 is connected to the LAN 51 through a network interface 53. When usedin a WAN networking environment, the personal computer 20 typicallyincludes a modem 54 or other means for establishing communications overthe WAN 52, such as the Internet. The modem 54, which may be internal orexternal, is connected to the system bus 23 via the serial portinterface 46. In a networked environment, program modules depictedrelative to the personal computer 20, or portions thereof, may be storedin the remote memory storage device. It will be appreciated that thenetwork connections shown are exemplary and other means of establishinga communications link between the computers may be used.

[0030] In order to provide the document with a set of grammatical anddata type rules governing the types and structure of data that may beincluded in a given document an XML schema is attached to or associatedwith the document for providing the rules governing each of the XMLelements and tags with which the user may annotate the given document.For example, a “purchase order” document may have an attached orassociated schema such as “purchaseorder-schema.xsd” for providing theallowable set of XML elements such as a <date> element, <price> element,<quantity> element, and so on. The schema includes the rules governingthe order with which those elements may be applied to the document andspecific rules associated with individual elements applied to thedocument. For example, a schema attached or associated with the“purchase order” document may prescribe that data associated with agiven element, for example a <date> element, must include a day element,followed by a month element, followed by a year element. Additionally,the schema may require that a <date> element must immediately precede a<shipment destination> element, for example.

[0031] As is understood by those skilled in the art, developers of XMLschemas determine the names of XML elements and the associated datatypes and data structures allowed for those elements. Then, all users ofdocuments annotated with XML structure according to a given schema mayutilize the data contained within the XML structure without regard tothe overall type and structure of the document. For example, if a“purchase order” document, described above, is transmitted to apurchaser of the goods, the purchaser may develop software applicationsfor parsing the document to locate specific types of data within thedocument for use by the purchaser. The purchaser may, for example onlywish to print serial numbers and associated prices for certain goods.Using the schema attached to the document, the purchaser will know thatthe data associated with the XML elements have been prepared accordingto the schema governing the document. Accordingly, the purchaser maydevelop a software application or an extensible Stylesheet LanguageTransformation (XSLT) file for locating the <price> element and forextracting the data associated therewith for insertion into thepurchaser's own documents.

[0032] Following with this example, a number of different purchasers maysubscribe to the same schema for dictating the rules associated with the“purchase order” document so that each purchaser may then receive the“purchase order” document from the author of the document and use thedata contained in the purchase order according to the XML elementsstructuring the data. That is, a first purchaser may only be interestedin the data contained within the <price> element, while a secondpurchaser may be interested in extracting only the data contained in a<shipment terms> element. Each purchaser may extract the data it desireswithout regard to other aspects or elements of the document by usingtheir own software applications or XSLT transformation files forlocating the desired data according to the XML structure. This is madepossible by the fact that each user of the document follows the datatype and data structure rules prescribed in the schema attached to orassociated with the document.

[0033] As understood by those familiar with the eXtensible MarkupLanguage, XML namespaces provide a method for qualifying elements andattribute names used in XML documents by associating those elements andattribute names with namespaces identified by uniform resourcesidentifier (URI) references. An XML namespace is a collection of names,identified by a URI reference, which are used in XML documents aselement types and attribute names. A single XML document may containelements and attributes that are defined for and used by multiplesoftware modules. For example, in accordance with an embodiment of thepresent invention, a single XML document, such as a spreadsheetdocument, may contain elements and attributes defined and used bydifferent software modules. For example, a spreadsheet document may haveelements and attributes defined for and used by a spreadsheetapplication XML processing module, or the document may contain elementsand attributes defined for and used by or associated with one or moreschema files associated with the document. For example, elements andattributes may be associated with the spreadsheet document to associatethe document with a schema file associated with a purchase order, resumedocument, a legal document, and the like. Accordingly, an individualdocument, such as an exemplary spreadsheet document may have a namespaceidentifying the element types and attribute names associated with eachof the different software modules that may consume or use data from thedocument. A set of standard XML data types has been defined by the WorldWide Web consortium (W3C) athttp://www.w3c.org/TR/xmlschema-0/simpletypestable, the disclosure ofwhich is incorporated here and by reference.

[0034] In order to import an XML data file to a spreadsheet document andin order to export an XML data file from a spreadsheet document, thespreadsheet application “remembers” the relationships between cells andlist objects in the spreadsheet application grid and correspondingelements or attributes of an associated XML schema file defining thestructure/blueprint of XML data documents corresponding to that schemafile. In order to remember the relationship between the cells and/orlist objects and elements or attributes of the associated XML schemafile, cells and/or list objects are mapped to associated elements orattributes in the schema file. For example, if a cell is supposed toreceive data when an XML data file is imported, that cell is referred toas a “mapped” cell as opposed to an “unmapped” cell that may receivedata entered by a user, but that does not receive data associated withan XML schema file attached to or associated with the imported XML datafile. In order to map a cell or list object with an associated elementor attribute of the XML schema file, markers known as XPATHs are storedin the spreadsheet document to point a given cell or list object to acorresponding element or attribute in an associated XML schema file. Useof and operation of XPATHs are defined by the World Wide Web consortium.

[0035] Accordingly, the mapping is a collection of XPATH markers thatdefine a relationship between the spreadsheet application grid and aparticular XML schema file where the XPATH is a pointer back to theassociated schema file. For example, if cell B1 has an XPATH marker thatpoints to the <date> element in an associated XML schema file, therelationship between cell B1 and the <date> element of the associatedschema file is maintained when an XML data file containing therelationship between cell B1 and the associated schema file is importedto a spreadsheet document 150 via a spreadsheet application 120. Forexample, if the imported XML data file 100 includes a <date> elementwith value “2 Jan. 2003”, and the map in the spreadsheet documentspecifies that cell B1 of the document 150 is related to the <date>element (by an XPATH referencing the <date> element), then cell B1 willcontain “2 Jan. 2003” once the import is finished. For a furtherdescription of mapping data in a document to an associated schema file,see U.S. Patent Application entitled “Markup Language Visual Mapping”,application Ser. No.: ______, filed ______ and assigned to the sameassignee as the present application, which is incorporated herein byreference as if fully set out herein.

[0036]FIG. 3 illustrates a computer screen display of a typicalspreadsheet application workspace and an associated tree view paneshowing a generalized instance of an XML schema file associated with thespreadsheet document. Further, FIG. 3 illustrates a mapping of XMLelements or attributes of the XML schema file to a spreadsheetapplication workspace grid. According to the exemplary screen display300 illustrated in FIG. 3, a spreadsheet application grid (hereafter“grid”) 160 is illustrated for entering, manipulating, and calculatingdata including text and numeric data. On the right hand side of thescreen display 300, a tree view 320 of a generalized instance of an XMLschema file is presented in a task pane 315. The tree view structure 320includes a root element 325, and child elements 330 and 340 and aplurality of child elements 335 and 345 under the elements 330 and 340,respectively. The tree view 320, illustrated in FIG. 3, represents a,generalized instance of an XML schema file attached to or associatedwith the spreadsheet document illustrated in the spreadsheet grid 160.Cells 355, 360, and 365 illustrate single non-repeating elements draggedto the grid 160, from the tree view structure 320. The list objects 370illustrate repeating elements, <description>, <amount> and <date>,dragged from the tree view structure 320 to the grid 160. As illustratedin FIG. 3, data associated with those elements is also illustrated. Thenon-repeating element 355, 360 and 365 are shown structured in cells D3,D4, and D5 of the grid 160. Associated data is entered into each ofthose cells, as shown in FIG. 3. The single non-repeating element <date>and the repeating elements <description> and <amount> are annotated attarget locations D8, E8, and F8 respectively. Associated data is shownas lists under headings associated with of those elements.

[0037] According to an embodiment of the present invention, dragging agiven element or attribute from the tree view 320 to the grid 160 allowsthe user to annotate a target location in the grid 160 with markuplanguage (for example, XML) structure associated with the dragged anddropped element or attribute. For example, referring to FIG. 3, the<date> element 335 is dragged from the tree view structure 320 to atarget location Cell D4 in the grid 160. Data associated with thattarget location, for example “2001-01-01” illustrated in FIG. 3, isshown in the target spreadsheet Cell D4. Once the selected element orattribute is dragged from the tree view structure 320 and is droppedonto a target location in the spreadsheet grid 160, an XPATH marker iswritten to the target location to point the target location back to theXML schema element or attribute to which the target location is nowassociated.

[0038] The mapping of the XML elements or attributes to target locationsin the spreadsheet grid, as described above, is advantageous because itallows the spreadsheet application to interact with other applicationsthat are not compatible with or otherwise do not speak the same languageof the spreadsheet. If the spreadsheet application imports XML data froma financial accounting system, for example, the accounting system doesnot have to know the data is being consumed by a spreadsheet applicationon the other end so long as the spreadsheet application can understandthe XML data in question (via an XML data mapping). Likewise, if thespreadsheet application exports data back to that accounting system, theaccounting system does not have to know the data is coming from thespreadsheet application so long as the data conforms to an XML schemathat the accounting system understands. If the consumer wishes toextract the “date” from the spreadsheet grid 310, the consumingapplication may make use of the mapping between the <date> element ofthe marked-up of, language schema file to the grid location D4 toreadily locate data associated with the “date” for extracting the dataor otherwise utilizing the data. That is, in accordance with embodimentsof the present invention, the annotation of the spreadsheet grid 160with markup language structure and association of that structure with amarkup language schema file for defining data associated with thestructure is maintained in the grid document for subsequent use andconsumption by other consuming spreadsheet applications or other typesof application capable of consuming and using the markup language datanow associated with the spreadsheet application grid 160.

[0039] Importing XML Data to a Spreadsheet Application Document

[0040]FIG. 4 is a flow chart illustrating a method for importing XMLdata into a spreadsheet document. In order to import an XML data file100 into a spreadsheet document 150 via the spreadsheet application 120,illustrated in FIG. 1, the method 400 begins at start step 405 andproceeds to step 410 where a data file including XML data is selectedfor importing to a spreadsheet application grid 160 of a spreadsheetdocument 150 via a spreadsheet application 120. As should be understood,the selection of a file may be done via an import function where a useris allowed to import data from a file or to import an entire file intothe grid 160 via of spreadsheet application 120. In the case of animport operation, the user chooses a source that gives XML data to thespreadsheet application grid. The source may be a file containing theXML data, or a stream of bytes containing XML data, or a web-basedservice, or any other application that outputs XML data.

[0041] In order to import and utilize XML data of the imported file, thefile must have been associated with an XML schema file, and the XMLschema must have been mapped to the spreadsheet grid. At step 415, thespreadsheet application identifies the XML data mapping that correspondsto the incoming XML data file. The matching XML data map correspondingto the XML data is found by matching the root name and namespace of theXML data with that of the XML schema file associated with all the mapsin the spreadsheet document. If more than one XML data mapping isavailable for the imported document, the user is queried via a userinterface to select one of the multiple available mappings. For example,if the imported XML document contains XML data for quarterly salesfigures, a first XML mapping may have been prepared, as described withreference to FIG. 3, using an XML schema file that defines the XML datawhere only the aggregate sales for each quarter are mapped to thespreadsheet document to give a summary report. A second XML mapping mayhave been created in the same spreadsheet document where a different setof elements and attributes from the XML schema may have been mapped togive a detailed report of the sales data.

[0042] At step 420, the XML data mapping is parsed so that each elementor attribute mapped to the grid is located. For instance, the first listobject or single mapped cell is found which has a mapping thatcorresponds to. the XML map being imported. If a single mapped cell isfound, the XPATH associated with it is obtained. This XPATH is passed toa flattening module that parses the XML data by loading it into adocument object model (DOM) parser that in turn fetches the data thatcorresponds to the XPATH. If a list object is found, all the XPATHsassociated with the columns of the list are collected. The collection ofXPATHs are passed to the flattening module which uses the DOM and theschema associated with the XML data map to determine the layout of theresulting data. The flattening module returns the data in a flat datastructure that can be populated in the spreadsheet document. As is knownto those skilled in the art, DOM parsers are tree-based parsers thatload an entire XML file into memory and SAX parsers are event-basedparsers capable of reading XML nodes (elements and/or attributes)sequentially, one at a time. According to document object models, adocument is presented as a logical structure rather than as a collectionof tagged words. The document object model is a means of defining adocument as a tree-like hierarchy of nodes in which the document is anobject containing other objects, such as images and forms. An example ofa DOM parser is MSXML DOM provided by Microsoft Corporation of Redmond,Wash. For a detailed description of a suitable flattening module, seeU.S. Patent Application entitled “Method and System for Converting aSchema-Based Hierarchical Data Structure into a Flat Data Structure,”Ser. No. ______, filed ______, assigned to the same assignee of thepresent application and which is incorporated herein by reference as iffully set out herein.

[0043] At step 425, once all XPATHs marked in the imported data file areobtained by the DOM parser, the XPATHs are passed to the XML processingmodule 105 for executing the XPATHs. At step 430, the XML processingmodule 105 executes each XPATH, one by one, against the XML data file tolocate all cells and list object ranges and for finding associated XMLelements or attributes applied to those cells and list object (list)ranges from the associated XML schema file.

[0044] At step 435, after each XPATH located in the XML data mapping forthe imported document is executed to obtain the cell or list object listrange locations for the XML data and the user data and for relating backto the associated schema file for associated XML schema definitions, alayout for the grid 160 of the spreadsheet worksheet associated with theimported data file is determined by the spreadsheet application 120 inconjunction with the XML processing module 105. At step 440, the cellsand list object list ranges of the grids 160 are populated withassociated XML data.

[0045] According to an embodiment of the present invention, when thedata is populated in the spreadsheet grid 160 for use by the user, thedata is converted from a hierarchical data structure associated with thedata mapping into a flattened structure for rendering a presentation inthe spreadsheet application grid. For a detailed description of amethods and systems for converting the hierarchically-structured datainto a flattened data structure for presentation to the user in thespreadsheet grid, see U.S. patent application entitled “Method andSystem for Converting a Schema-Based Hierarchical Data Structure into aFlat Data Structure,” Ser. No. ______, filed ______, assigned to thesame assignee of the present application and which is incorporatedherein by reference as if fully set out herein. As should be understood,after the data obtained from the flattening module is properly formattedand populated into the spreadsheet cells or lists, the process continuesagain until all data for all the cells and lists associated to the XMLmapping are imported into the spreadsheet grid. The method ends at step495.

[0046] Exporting XML Data from a Spreadsheet Application Worksheet

[0047] Referring to FIG. 5, after a user has imported XML data to thespreadsheet application grid 160 for editing, as described withreference to FIG. 4, or after the user has created a new XML documentand mapped an associated schema file to that document, the user mayexport the XML document along with XML markup, XML data, and XML datamapping for subsequent use. According to embodiments of the presentinvention, the user may also export an XML document where XML structureis associated (via a schema (XSD)) to a spreadsheet having pre-existingdata. Advantageously, upon export, all relationships created betweencell and list object locations in the spreadsheet application grid 160and the associated schema file are maintained for subsequent use by anyother XML-enabled application. Referring to FIG. 5, a method forexporting XML data from a spreadsheet document according to anembodiment of the present invention is described. The method 500 beginsat start step 505 and proceeds to step 510 where an XML data file isselected for exporting. As briefly described above, the XML data filemay be a data file previously imported, as described with reference toFIG. 4, or the data file may be a new file created by the user who nowdesires to export the data file. According to an embodiment of theinvention, the user may be prompted for a name of a file that will becreated and to which the XML document will be written. If the named filealready exists, the user may be prompted as to whether to overwrite thefile or to choose a different file name.

[0048] At step 515, an XML data mapping defining the relationshipbetween XML data in the document to be exported and an associated schemafile is selected. The XML data mapping selected for the export of thedata may be the mapping used for importing the data, as described abovewith reference to FIG. 4. Alternatively, if the data file to be exportedis being created by the user, an XML data mapping between the documentgrid 160 and an associated schema file may be created, as describedabove with reference to FIG. 3. At step 520, a determination is made asto whether more than one XML data mapping is present. If there is morethan one, the user is prompted to specify which mapping to export. Asdescribed above with reference to FIG. 4, the document previouslyimported by the user, or being created by the user may have more thanone mapping associated with an XML schema file. If more than one XMLdata mapping is present, the method proceeds to step 520, and the useris queried via a user interface for a selection of one of multiple datamappings. Once a mapping is selected, the method proceeds to step 530,and the XML data mapping is obtained for use in preparing the data forexporting.

[0049] At step 535, the XML data mapping is matched to a generalizedinstance structure created for the associated schema file, as describedabove with reference to FIG. 3. As described above, the generalizedinstance structure is a tree-like hierarchical representation of an XMLhierarchical data structure where all available elements and/orattributes of an associated schema file are applied to the document.That is, the instance structure represents a potential hierarchical datastructure of a document having all potential elements and/or attributesof an associated schema file applied to the document. At step 535, theselected XML data mapping is matched to a corresponding generalizedinstance structure. For example, if the XML data mapping was prepared inassociation with a purchase order schema file at step 535, that XML datamapping is matched to a corresponding generalized instance structureprepared for the purchase order schema file.

[0050] At step 540, the XML data mapping's generalized instancestructure is passed to the XML processing module 105. The XML exportmodule iterates the grid's data to extract references to the dataassociated to the mapping specified by the user. The references arestored in the generalized instance structure. According to an embodimentof the present invention, the XML processing module walks through theXML data mapping node by node for the document to be exported to findthe location of and content of XML data applied to the document.Advantageously, iteration of the map to find data associated with thespreadsheet document allows the XML export module to associate datacontained in the spreadsheet document with corresponding XML structurein the generalized instance structure so that the location andhierarchical order of the data may be determined for the eventual exportof the data for subsequent use.

[0051] At step 545, the XML processing module 105 locates each elementand/or attribute applied from the associated schema file to thespreadsheet document via the mapping between the generalized instancestructure of the XML schema file to the spreadsheet document. For eachreference in the XML data mapping located by the XML export module, theXML export module obtains an XPATH marking the location of the XML datain the document and pointing that location and data back to the XMLschema file. For example, if the XML export module comes to a firstreference in the XML data mapping that is representative of a <firstname> XML data element, the XML processing module 105 obtains theassociated XPATH, for example, “purchaseorder/person/fname” for pointingto the <first name> child element of the element <person> which in turnis a child element of the element <purchaseorder> of an associatedpurchase order schema file applied to the document. In effect, each cellor list object annotated with XML data according to the associated XMLschema file is located by walking a list of XML data mappings. Theassociated XPATH locating a cell or list object and data associatedtherewith is used to apply the XML data to the generalized instancestructure of the associated XML schema file to prepare ahierarchically-structured representation of the XML data and associateduser data contained in the document. At step 550, each XPATH obtained bythe XML export module and associated with a given XML data element orattribute applied to the document is used to associate each appliedelement or attribute to the generalized instance structure associatedwith the selected XML schema file. In effect, the generalized instancestructure is “filled in” to indicate which elements and/or attributes ofthe generalized instance structure of the selected XML schema file areactually applied to the document.

[0052] If the location of a single non-repeating element or attribute isfound, the associated XPATH for the location and the associated datawill be pushed out to the generalized instance structure, as describedabove. However, if during iteration of the map at step 540, a listobject is found having a cell range, for example cell C5 through cellC15, an indication is made that the list object is associated with arepeating element in generalized instance structure of the associatedXML schema file. In response, the XML export module analyzes thehierarchical structure of the generalized instance structure to find theXML element associated with the list found in the application documentand determines the minimum number of repeats associated with theelement. This is required in order to ultimately know where theassociated data is located in the document so that the data may bepushed out to the generalized instance structure for creating ahierarchically-structured representation of the XML document for export.

[0053] At step 555, the mapped data associated with each XPATH in thedocument is extracted, and at step 560 the extracted data is arranged bythe XML export module 37 according to the generalized instancestructure. In order to arrange the extracted data in a hierarchicalstructure, the XML processing module 105 walks down the generalizedinstance structure one node at a time to prepare the data for writing tomemory and for validating the data against the XML schema file. Forexample, if the DOM parser and SAX module locates a first elementcorresponding to a single non-repeating <name> element, the data, ifany, contained in the cell associated with that element is validatedagainst the <name> element of the associated schema file. That is, ifthe <name> element requires a first name, followed by a middle name,followed by a last name, the DOM parser and SAX module determine if theassociated data is valid according to that data type and structure. Ifthe data is not valid, a schema validation error may be presented to theuser.

[0054] If the XML processing module locates a list object that repeats,for example ten times, according to the generalized instance structureof the XML schema file, then associated data of the ten cells arearranged for the eventual export. With each cell in the column that isarranged, data associated therewith is validated against the XML schemafile, described above. According to a preferred embodiment of thepresent invention, the rendering of the data according to the associatedschema file is honored unless the rendering dictated by the schema filewill cause a loss of user entered data. For example, if the associatedschema file requires that an annotated cell contain a whole number, butthe user-entered a decimal value (for example, whole number 8 versusdecimal number 8.5), the decimal value will be written out to memory,and the user will be provided with an XML schema validation error.

[0055] At step 565, the XML export module via the SAX module writes outthe hierarchically-structured data to memory for subsequent import anduse as described above with reference to FIG. 4. As should be understooda variety of options are available when the data is written out tomemory at step 565. The data may be written to memory for future importas described with reference to FIG. 4, or the data may be transformedusing a transformation file such as an eXtensible Stylesheet LanguageTransformation (XSLT) file to transform the data into a different formatfor subsequent consumption, for example, consumption by a HypertextMarkup Language processing module. Alternatively, at step 565 the datamay be sent to another user for import by the second user utilizinganother spreadsheet application program 120, or alternatively, forimport by a different software application, such as a word-processingapplication. If the document is sent to another user for import by thesecond user utilizing a separate software application program, such as aword processing application, the spreadsheet functionality associatedwith the document created by the first user may be lost, butadvantageously, the XML formatting of the data including XML tags andapplication of elements and/or attributes from the associated schemafile are maintained in the data for use by the second user.

[0056] Additionally, during the process of writing out the data tomemory at step 565, a determination may be made based on the associatedschema file as to whether or not a given element is optional. That is,according to one embodiment, a determination may be made as to whetheran element applied to the document that should be rendered according tothe associated schema file may nonetheless be omitted where, forexample, rendering the element will generate a blank cell. For examplesometimes an element is expressed that is not optional, but the elementdoes not have data in the document location to which it is applied, forexample, a NIL value. If a cell has an Integer data type according tothe associated schema file, but the cell does not have an expressedvalue, a zero(0) cannot be expressed in the cell because a zero is avalid Integer data type that in all probability does not convey theintent of a cell with no data content. For another example, say a<price> element is optional, and twenty <price> elements must be parsedaccording to the general instance structure of the associated schemafile. If the schema file dictates that the <price> element is required,each time a <price> element is parsed having no associated price items(user data) an empty element is written. An empty element is shorthandfor having an open tag and a closed tag with nothing in between.

[0057] As is known to those skilled in the art, in the described examplecase XML syntax may be written to prevent an empty cell from filling inwith zeros. For example, when a cell has no data content, XML syntax maybe written to prevent that empty cell from filling in with zeros. Asdescribed above, one example is an empty element that is required andanother example is where a number data type such as an Integer data typeis required and the user does not enter data to the cell. In either ofthese cases, writing a blank as a description would not be valid againstthe associated schema file, and a schema validation error would occurand likely confuse a user. According to one embodiment, if the XSDdefines the element to be “illable” a NIL value is written to the cellby writing an attribute of “xsi:nil=‘true”’ where the namespace prefix“xsi” is associated to the http://www.w3c.org/2001/XMLSchema-instancenamespace in that location so that the schema validation process willignore the cell. On export, the element may be tagged stating that thecell should be expressed as a NIL value that will prevent a validationerror from being provided to the user. If an element is required, butwhere no data is provided, according to one embodiment, the element maybe written out to memory at step 565 to adhere to the associated schemafile, and an empty element may be written out even though it is invalidversus the schema file, but where it is the best interpretation of theuser's desires. A schema validation error may then be presented to theuser to alert the user.

[0058] Contextual Awareness

[0059] According to embodiments of the present invention, mapping XMLdata to the spreadsheet grid, as described herein, may also exposeapplication programming interfaces (API) that allow a programmer to“peer into” the XML map and use it for other purposes. According to afirst aspect of this embodiment, if a programmer is working with aspecific XML schema such as a purchase order (PO) schema, she may wantto write a custom program that provides the user with actions such as“Check status of this purchase order” wherever purchase order data isencountered, and the programmer may want those actions to show up“inline” in the spreadsheet document. Because the XML mapping feature,described above, allows the PO schema to be used in differentspreadsheet documents (each providing a different “view” of the XMLpurchase order data), the programmer cannot write a program that worksin all places. For example, the “Check status” action needs to haveaccess to the <id> element of the PO data in order to know whichpurchase order it should look up for the user. The programmer thereforeneeds a way to “discover” whether the <id> element is present at all inthe spreadsheet document. Once it has been determined that the <id>element is present, the program code needs to know where the <id>element is mapped in the grid. Once the program code knows where the<id> element is mapped, the program code is able to fetch the value ofthe spreadsheet cell to which the <id> element is mapped, as describedabove. The program code may also use this location to draw theappropriate user interface (button, etc.) in the vicinity of thatspreadsheet cell.

[0060] The objects are declared that will hold the location and valueresults to be obtained as described above. The element XPATH of theelement needed by the programmer is passed to an XmlMapQuery method tofind the location of the element. In response, a Range object isreturned which represents some area in the spreadsheet applicationspreadsheet. If the desired element does not exist, meaning it has notbeen mapped into this particular spreadsheet, the Range returned will be‘empty’ or un-initialized. In response, the programmer/user checks foran “empty” Range before continuing. If the Range is not empty, a call ismade (e.g., XmlDataQuery) to fetch the Range that contains the actualdata for the Range. XmlMapQuery and XmlDataQuery in many cases returnthe exact same Range. However, element mappings may contain extrainformation, such as headers, which would be returned by XmlMapQuery,whereas XmlDataQuery returns just the data.

[0061] In addition, sometimes a mapping for a particular element mayexist, but no data may exist in the mapping yet, in which caseXmlDataQuery would return an “empty” Range, while XmlMapQuery wouldreturn valid Range. In such cases, the programmer/user may first queryfor the existence of the mapping using XmlMapQuery before accessing thevalue of that mapping with XmlDataQuery. Next, a determination is madeas to whether the mapping (Range) contains any data. The location of thedata in the spreadsheet can be obtained from the Range. Accessing thevalue of the element is also done with this Range. The Range may containmore than one cell, but for the purposes of the example, only the firstcell having a Range “IdRange” is accessed.

[0062] According to a second aspect of this embodiment, if theprogrammer/user may desire to write a program that is able to work withmultiple different XML schemas. For example, consider an automobilecompany that produces cars, trucks, and buses where there is an XMLschema for each type of vehicle that describes all of the parts that gointo that type of vehicle. The company may also have a general-purposespreadsheet template for ordering parts. Users must customize thattemplate by mapping the appropriate elements from one of the threeschemas to the “Order Table” section of the spreadsheet. Once they havecreated the mapping, they can fill out the Order Table.

[0063] Continuing with the example, the programmer may want to providethe users with actions that help them fill out the order table, forexample, an action like “Get quote.” The programmer already knows wherethe Order Table is in the spreadsheet, but does not know which schema(cars, trucks, buses) the user will have mapped in each case, nor theelements that the user mapped from the particular schema. The programmerfirst declares the objects that will hold the results to be obtainedbelow. Next the programmer addresses a Range in the spreadsheetcorresponding to one of the columns in the “Order Table”. For example,the.programmer looks up the “Part Number” column in the table, andretrieves the XML XPATH information from that Range. The programmer thenchecks to make sure that the column is indeed mapped before proceeding.The XPATH object provides useful information to the programmer. Forexample, the XPATH may give the programmer the XPATH identifier of theelement that is mapped to this column. According to the present example,the programmer may be interested in identifying the schema that ismapped to this table, so that she knows how to appropriately request aprice quote. She does this by accessing the XmlMap object (viaXPath.Map) associated with XPATH object, followed by retrieving thenamespace value from RootElementNamespace that uniquely identifies theschema being used. After the programmer knows which schema is in use inthis table, she performs the action that is appropriate to the givenschema, such as inserting a code to get a quote for car parts.

[0064] As described herein, embodiments of the present invention relateto importing markup language data to and exporting markup language datafrom a spreadsheet application grid. It will be apparent to thoseskilled in the art that various modifications or variations may be madein the present invention without departing from the scope or sprit ofthe invention. Other embodiments of the invention will be apparent tothose skilled in the art from consideration of this specification andpractice of the invention disclosed herein.

We claim:
 1. A method of utilizing markup language data in a spreadsheetdocument, comprising: selecting a data file containing markup languagedata for importing into a spreadsheet document whereby the data file hasapplied markup language data mapped to a spreadsheet document;identifying a markup language data mapping whereby each element orattribute of the markup language applied to the data file is mapped toan associated schema file for defining data definitions for the elementsor attributes applied to the document; parsing the data mapping toobtain pointers associated with markup language elements and attributesapplied to the data file pointing to the applied elements and attributesof the associated schema file; executing each pointer to find locationsof elements or attributes applied to the data file; executing eachpointer to the schema file to obtain markup language data definitionsapplicable to the elements or attributes according to the schema file;determining a layout for rendering the data file to a spreadsheetdocument based on the locations of each of the elements or attributesapplied to the data file; and rendering the data file in a spreadsheetdocument whereby the elements or attributes in any user data associatedwith the elements or attributes are positioned in the document accordingto the layout.
 2. The method of claim 1, whereby the step of renderingthe data file in a spreadsheet application includes rendering the datafile in a spreadsheet document whereby any user data associated with theelements or attributes are positioned in the document according to thelayout.
 3. The method of claim 1, whereby parsing the data mapping toobtain pointers associated with markup language elements and attributesapplied to the data file pointing to the applied elements and attributesof the associated schema file includes parsing the data mapping toobtain pointers saved to positions in the data file associated with eachelement or attribute applied to the data file for pointing each elementor attribute applied to the data file to a corresponding data definitionin the schema file.
 4. The method of claim 3, whereby the step ofparsing the data mapping to obtain pointers associated with markuplanguage elements and attributes applied to the data file pointing tothe applied elements and attributes of the associated schema fileincludes parsing the data mapping with a document object model parser.5. The method of claim 4, whereby parsing the data mapping to obtainpointers associated with markup language elements and attributes appliedto the data file pointing to the applied elements and attributes of theassociated schema file includes obtaining XPATHs written to the datafile pointing elements applied to the data file to data definitions foreach element or attribute applied to the data file from the associatedschema file.
 6. The method of claim 1, whereby identifying a markuplanguage data mapping includes matching a root name of a markup languagenamespace associated with the schema file to root elements applied tothe data file.
 7. The method of claim 6, whereby if more than one datamapping is identified for the data file, selecting one mapping from theone or more data mappings.
 8. The method of claim 7, whereby selectingone data mapping from the one or more data mappings includes querying auser for a selection of the one data mapping from the one or more datamappings.
 9. The method of claim 8, whereby querying a user for aselection of the one mapping includes querying the user via a userinterface.
 10. The method of claim 1, further comprising passing theeach pointer to a markup language processing module.
 11. The method ofclaim 1, whereby the step of executing each pointer to find locations ofelements or attributes applied to the data file includes obtaining theelements and attributes applied to the data file for rendering the datafile in the spreadsheet document.
 12. The method of claim 11, furthercomprising obtaining any user data in the data file associated withelements and attributes applied to the data file for rendering in thespreadsheet document.
 13. The method of claim 12, whereby the locationsof elements or attributes applied to the data file correspond to cellsof a spreadsheet application grid for rendering the spreadsheetdocument.
 14. The method of claim 12, whereby the locations of elementsor attributes applied to the data file correspond with list ranges forlist objects of a spreadsheet application grid for rendering the datafile in a spreadsheet document.
 15. The method of claim 1, prior to thestep of rendering the data file in the spreadsheet document, populatingthe locations of each element or attribute with the correspondingelement or attributes and markup language data definitions from theassociated schema file.
 16. The method of claim 15, further comprisingpopulating the locations of each of the elements or attributes with anyassociated user data.
 17. The method of claim 16, whereby the step ofrendering the data file in a spreadsheet document includes convertingthe data from a hierarchical structure to a flattened data structure forrendering the data in a spreadsheet document.
 18. The method of claim17, further comprising formatting any user data rendered in thespreadsheet document according to the data definitions associated withan element or attribute applied to the location of the any user dataaccording to the associated schema file.
 19. The method of claim 1,further comprising modifying the elements or attributes applied to thedata file including applying additional elements or attributes to thedocument from the associated schema file.
 20. The method of claim 19,whereby the step of modifying the elements or attributes applied to thedata file includes deleting elements or attributes from the document.21. The method of claim 19, further comprising modifying any user dataapplied to the document associated with the elements or attributesapplied to the document according to the associated schema file.
 22. Themethod of claim 21, further comprising the step of updating the mappingto include modifications to any elements or attributes applied to thedata file and to include modifications to any user data applied to thedata file.
 23. The method of claim 22, further comprising exporting themodified data mapping, the modified elements or attributes and themodified user data for subsequent rendering in a second documentaccording to the modified mapping and associated schema file.
 24. Themethod of claim 22, prior to the step of updating the mapping, modifyingthe elements or attributes applied to the data file according to theschema file.
 25. The method of claim 1, whereby the markup language isthe eXtensible Markup Language.
 26. A method of exporting markuplanguage data from a spreadsheet application, comprising: selecting aspreadsheet document containing markup language data for exporting;selecting a data mapping for relating markup language data in thedocument with a schema file associated with the document; matching theselected data mapping to an instance structure of the associated schemafile; comparing the instance structure and the data mapping to determinewhat markup language elements or attributes have been applied to thedocument from the associated schema file; parsing through each node ofthe data mapping to find the location and content of markup languageelements or attributes applied to the document; populating the instancestructure with elements or attributes applied to the document;extracting the elements or attributes and any associated user data fromthe instance structure; arranging the extracted elements or attributesand any associated user data into a data file according to the instancestructure of the schema file; and writing the data file to memory forexporting.
 27. The method of claim 26, whereby if more than one datamapping is identified for the document, selecting one data mapping fromthe one or more data mappings.
 28. The method of claim 27, wherebyselecting one data mapping from the one or more data mappings includesquerying a user for a selection of the one data mapping from the one ormore data mappings.
 29. The method of claim 28, whereby the step ofquerying a user for a selection of the one data mapping from the one ormore data mappings includes querying the user via a user interface. 30.The method of claim 1, whereby matching the selected data mapping to aninstance structure of the associated schema file matching the selecteddata mapping to an instance structure representing all availableelements and attributes of the associated schema file that may beapplied to the document.
 31. The method of claim 26, whereby the step ofparsing through each node of the data mapping to find the location andcontent of markup language elements or attributes applied to thedocument includes associating markup language elements or attributes andany associated user data in the document with corresponding markuplanguage elements or attributes in the instance structure fordetermining the location and content of the markup language elements anduser data.
 32. The method of claim 31, further comprising obtaining apointer marking the location of each element or attribute applied to thedocument and pointing the location and associated element or attributeto a corresponding element or attribute in the schema file.
 33. Themethod of claim 26, whereby arranging the extracted date includesarranging the extracted data into a hierarchical structure using adom/sax parser.
 34. The method of claim 26, whereby the markup languageis the eXtensible Markup Language.
 35. A method of importing eXtensibleMarkup Language (XML) data into a spreadsheet document and for exportingXML data from a spreadsheet document, comprising: selecting a data filecontaining XML data for importing into a spreadsheet document; renderingthe XML data in the spreadsheet document according to a previouslydefined mapping of selected XML data to selected target locations in thedocument; modifying the XML data rendered in the spreadsheet document;updating the mapping to include modifications to the XML data; exportingthe modified XML data and updated mapping for subsequent rendering in asecond spreadsheet document according to the updated mapping.
 36. Themethod of claim 35, whereby the step of modifying the XML data renderedin the spreadsheet document includes modifying XML data applied to thedocument and modifying user data entered into the document; and wherebythe step of exporting the modified XML data and updated mapping includesexporting modified user data entered into the document.
 37. A method ofimporting eXtensible Markup Language (XML) data into a spreadsheetdocument and for exporting XML data from a spreadsheet document,comprising: selecting a data file containing XML data for importing intoa spreadsheet document whereby the data file has applied XML data mappedto a spreadsheet document; identifying an XML data mapping whereby eachelement or attribute of the XML applied to the data file is mapped to anassociated schema file for defining data definitions for the elements orattributes applied to the document; parsing the data mapping to obtainpointers associated with XML elements and attributes applied to the datafile pointing to the applied elements and attributes of the associatedschema file; executing each pointer to find locations of elements orattributes applied to the data file; executing each pointer to theschema file to obtain XML data definitions applicable to the elements orattributes according to the schema file; determining a layout forrendering the data file to a spreadsheet document based on the locationsof each of the elements or attributes applied to the data file;rendering the data file in a spreadsheet document whereby the elementsor attributes in any user data associated with the elements orattributes are positioned in the document according to the layout; afterrendering the data file in a spreadsheet document, modifying the datafile in the spreadsheet document; updating the data mapping to includemodifications to any elements or attributes applied to the data file andto include modifications to any user data applied to the data fileselecting the modified data file for exporting to a memory location;selecting the updated data mapping for relating XML data in the documentwith a schema file associated with the document; matching the selectedupdated data mapping to an instance structure of the associated schemafile; comparing the instance structure and the updated data mapping todetermine what XML elements or attributes have been applied to thedocument from the associated schema file; parsing through each node ofthe updated data mapping to find the location and content of XMLelements or attributes applied to the document; populating the instancestructure with elements or attributes applied to the document;extracting the elements or:attributes and any associated user data fromthe instance structure; arranging the extracted elements or attributesand any associated user data into a data file according to the instancestructure of the schema file; and writing the data file to memory. 38.The method of claim 37, whereby the step of modifying the data file inthe spreadsheet document includes modifying the elements or attributesapplied to the data file including applying additional elements orattributes to the document from the associated schema file, or deletingelements or attributes from the document.
 39. The method of claim 38,further comprising modifying any user data applied to the documentassociated with the elements or attributes applied to the documentaccording to the associated schema file.
 40. The method of claim 39,whereby the step of writing the data file to memory further comprisesexporting the updated data mapping, the modified elements or attributesand the modified user data for subsequent rendering in a second documentaccording to the updated mapping and associated schema file.
 41. Acomputer readable medium having computer executable instructionscontained thereon which when executed by a computer perform thefollowing steps for utilizing markup language data in a spreadsheetdocument: selecting a data file containing markup language data forimporting into a spreadsheet document whereby the data file has appliedmarkup language data mapped to a spreadsheet document; identifying amarkup language data mapping whereby each element or attribute of themarkup language applied to the data file is mapped to an associatedschema file for defining data definitions for the elements or attributesapplied to the document; parsing the data mapping to obtain pointersassociated with markup language elements and attributes applied to thedata file pointing to the applied elements and attributes of theassociated schema file; executing each pointer to find locations ofelements or attributes applied to the data file; executing each pointerto the schema file to obtain markup language data definitions applicableto the elements or attributes according to the schema file; determininga layout for rendering the data file to a spreadsheet document based onthe locations of each of the elements or attributes applied to the datafile; and rendering the data file in a spreadsheet document whereby theelements or attributes in any user data associated with the elements orattributes are positioned in the document according to the layout.
 42. Acomputer readable medium having computer executable instructionscontained thereon which when executed by a computer perform thefollowing steps for exporting markup language data from a spreadsheetapplication: selecting a spreadsheet document containing markup languagedata for exporting; selecting a data mapping for relating markuplanguage data in the document with a schema file associated with thedocument; matching the selected data mapping to an instance structure ofthe associated schema file; comparing the instance structure and thedata mapping to determine what markup language elements or attributeshave been applied to the document from the associated schema file;parsing through each node of the data mapping to find the location andcontent of markup language elements or attributes applied to thedocument; populating the instance structure with elements or attributesapplied to the document; extracting the elements or attributes and anyassociated user data from the instance structure; arranging theextracted elements or attributes and any associated user data into adata file according to the instance structure of the schema file; andwriting the data file to memory for exporting.
 43. A computer readablemedium having computer executable instructions contained thereon whichwhen executed by a computer perform the following steps for importingeXtensible Markup Language (XML) data into a spreadsheet document andfor exporting XML data from a spreadsheet document, comprising:selecting a data file containing XML data for importing into aspreadsheet document; rendering the XML data in the spreadsheet documentaccording to a previously defined mapping of selected XML data toselected target locations in the document; modifying the XML datarendered in the spreadsheet document; updating the mapping to includemodifications to the XML data; exporting the modified XML data andupdated mapping for subsequent rendering in a second spreadsheetdocument according to the updated mapping.